<template>
<div>
  <div>
    <el-table
        :data="meet"
        style="width: 100%">
      <el-table-column
          prop="time"
          label="面试时间"
          width="180">
      </el-table-column>
      <el-table-column
          prop="name"
          label="面试者姓名"
          width="180">
      </el-table-column>
      <el-table-column
          prop="phone"
          label="面试者手机号码">
      </el-table-column>
      <el-table-column
          prop="toeamil1"
          label="面试者邮箱">
      </el-table-column>
      <el-table-column
          prop="interviewer"
          label="面试官">
      </el-table-column>
      <el-table-column
          label="进度">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status === 0" type="primary" size="small">未面试</el-tag>
          <el-tag v-else-if="scope.row.status === 1" type="success" size="small">已通过</el-tag>
          <el-tag v-else-if="scope.row.status === 2" type="danger" size="small">未通过</el-tag>
        </template>
      </el-table-column>
      <el-table-column
          label="操作">
        <template slot-scope="scope">
          <el-button-group v-if="scope.row.status===0">
            <el-button type="primary" size="mini" @click="pass(scope.$index,scope.row)"  icon="el-icon-check"></el-button>
            <el-button type="danger" size="mini" @click="reject(scope.$index,scope.row)" icon="el-icon-close"></el-button>
          </el-button-group>
        </template>
      </el-table-column>
    </el-table>
  </div>
  <div>
  </div>
</div>
</template>

<script>
export default {
  name: "PerEc",
    data(){
      return{
        meet:{
          id:"",
          phone:"",
          tomeail1:"",
          interviewer:"",
          time:"",
          name:"",
          status:"",
        },
      }
    },
    methods:{
      initInterviews(){
        this.getRequest('/interview/').then(resp=>{
          if(resp){
            this.meet = resp;
          }
        })
      },
      pass(index,data){
        this.putRequest('/interview/pass',data).then(resp=>{
          console.log(data)
          if(resp){
            this.initInterviews();
          }
        })
      },
      reject(index,data){
        this.putRequest('/interview/reject',data).then(resp=>{
          console.log(data)
          if(resp){
            this.initInterviews();
          }
        })
      },
    },
  mounted() {
    this.initInterviews();
  }
}
</script>

<style scoped>

</style>